package zhh.tangbao.commodity.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *     描述
 * </p>
 * @author 粥灰灰
 * <p>2023/3/21</p>
 */

public enum OrderStatus {

    SUBMIT_BUT_NOT_PAY(0, "提交但未支付订单"),
    PICKED(1, "已取货，订单完成"),
    PAY_BUT_NOT_PICKED(2, "已支付但未完成取货"),
    REFUND(3, "申请退款中"),
    REFUNDED(4, "退款完成"),
    CANCEL(5, "订单在付款前被取消");


    private Integer code;

    private String label;

    OrderStatus(Integer code, String label) {
        this.code = code;
        this.label = label;
    }

    public Integer getCode() {
        return code;
    }

    public String getLabel() {
        return label;
    }

    public static Map<Integer, String> getOrderStatusMap() {
        return new HashMap<Integer, String>(){{
            put(SUBMIT_BUT_NOT_PAY.code, SUBMIT_BUT_NOT_PAY.label);
            put(PICKED.code, PICKED.label);
            put(PAY_BUT_NOT_PICKED.code, PAY_BUT_NOT_PICKED.label);
            put(REFUND.code, REFUND.label);
            put(REFUNDED.code, REFUNDED.label);
            put(CANCEL.code, CANCEL.label);
        }};
    }
}
